package com.ruoyi.project.drug.service.impl;

import com.ruoyi.project.drug.domain.Drug;
import com.ruoyi.project.drug.mapper.DrugMapper;
import com.ruoyi.project.drug.service.IDrugService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Arrays;
import java.util.List;

/**
 * @Classname DrugServiceImpl
 * @Description
 * @Date 2022/6/28 19:52
 * @Author Lee
 */
@Service
public class DrugServiceImpl implements IDrugService {
    @Autowired
    private DrugMapper drugMapper;
    @Override
    public List<Drug> selectDrugList(Drug drug) {
        return drugMapper.selectDrugList(drug);
    }

    @Override
    public int insertDrug(Drug drug) {
        return drugMapper.insertDrug(drug);
    }

    @Override
    public int updateDrug(Drug drug) {
        return drugMapper.updateDrug(drug);
    }

    @Override
    public int batchDelete(Integer[] drugIds) {
        System.out.println(Arrays.toString(drugIds));
        return drugMapper.batchDelete(drugIds);
    }

    @Override
    public Drug getDrugById(Integer id) {
        return drugMapper.getDrugById(id);
    }

    @Override
    public List<Drug> selectBySupportId(Integer supportId) {
        return drugMapper.selectBySupportId(supportId);
    }
}
